<%@ Page Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeFile="News.aspx.cs"
    Inherits="News" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table width="100%">
        <tr>
            <td>
                <h1>
                    <asp:Label runat="server" ID="_header" /><% 
                                    if (PageNumber > 0)
                                    {
                                        Response.Write(string.Format(" - page {0}", PageNumber + 1));
                                    }
                    %></h1>
            </td>
            <%-- PAGER 1 --%>
            <asp:Repeater ID="rptPages1" runat="server">
                <HeaderTemplate>
                    <td style="text-align: right;">
                        <b>Page:</b>
                    &nbsp;
                </HeaderTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="btnPage" CommandName="Page" CommandArgument="<%#
                         Container.DataItem %>" CssClass="text" runat="server"><%# Container.DataItem %>
                    </asp:LinkButton>&nbsp;
                </ItemTemplate>
                <FooterTemplate>
                    </td>
                </FooterTemplate>
            </asp:Repeater>
        </tr>
    </table>
    <%-- NEWS ITEMS --%>
    <asp:Repeater ID="rptItems" runat="server">
        <HeaderTemplate>
        </HeaderTemplate>
        <ItemTemplate>
            <div class="newsBox">
                <div class="newsTitle">
                    <asp:Image ID="Image1" runat="server" ImageUrl="~/images/silk/bell.png" />
                    <%# Eval("Title") %>
                </div>
                <div class="newsSubTitle">
                    <%# GetNewsDate((DateTime)Eval("News_date")) %>
                </div>
                <div class="NewsBody">
                    <%# GetNewsAsHtml(((string)Eval("News_message")).Replace("\n", "<br/>")) %>
                </div>
            </div>
        </ItemTemplate>
        <SeparatorTemplate>
            <div class="horRule">
                <hr />
            </div>
        </SeparatorTemplate>
        <FooterTemplate>
        </FooterTemplate>
    </asp:Repeater>
    <%-- PAGER 2 --%>
    <asp:Repeater ID="rptPages2" runat="server">
        <HeaderTemplate>
            <div style="text-align: right;">
                <b>Page:</b>
            &nbsp;
        </HeaderTemplate>
        <ItemTemplate>
            <asp:LinkButton ID="btnPage" CommandName="Page" CommandArgument="<%#
                         Container.DataItem %>" CssClass="text" runat="server"><%# Container.DataItem %>
            </asp:LinkButton>&nbsp;
        </ItemTemplate>
        <FooterTemplate>
            </div>
        </FooterTemplate>
    </asp:Repeater>
</asp:Content>
